cmake_minimum_required(VERSION 3.10)

project(test-dfmplugin-sidebar)

set(PluginPath ${PROJECT_SOURCE_PATH}/plugins/filemanager/core/dfmplugin-sidebar/)
set(ModelPath ${PluginPath}/treemodels/)
set(ViewPath ${PluginPath}/treeviews/)
set(EventPath ${PluginPath}/events/)
set(UtilsPath ${PluginPath}/utils/)
include_directories(${ViewPath})
include_directories(${ModelPath})
# UT文件
file(GLOB_RECURSE UT_CXX_FILE
    FILES_MATCHING PATTERN "*.cpp" "*.h")
#file(GLOB_RECURSE SRC_FILES
#    FILES_MATCHING PATTERN "${PluginPath}/*.cpp" "${PluginPath}/*.h")
file(GLOB SRC_FILES
    FILES_MATCHING PATTERN "${PluginPath}/*.h" "${PluginPath}/*.cpp"
    FILES_MATCHING PATTERN "${UtilsPath}/*.h" "${UtilsPath}/*.cpp"
    FILES_MATCHING PATTERN "${EventPath}/*.h" "${EventPath}/*.cpp"
    FILES_MATCHING PATTERN "${ModelPath}/*.h" "${ModelPath}/*.cpp"
    FILES_MATCHING PATTERN "${ViewPath}/*.h" "${ViewPath}/*.cpp"
    FILES_MATCHING PATTERN "${ViewPath}/private/*.h"
    )

add_executable(${PROJECT_NAME}
    ${SRC_FILES}
    ${UT_CXX_FILE}
    ${CPP_STUB_SRC}
)

find_package(Dtk COMPONENTS Widget REQUIRED)

target_include_directories(${PROJECT_NAME} PRIVATE
    "${PluginPath}")
target_link_libraries(${PROJECT_NAME} PRIVATE
    DFM::base
    DFM::framework
    ${DtkWidget_LIBRARIES}
)

add_test(
  NAME sidebar
  COMMAND $<TARGET_FILE:${PROJECT_NAME}>
)
